Accessibility

DRK Volume 4 Article

Getting Started with Search Application


The Search Application sample application provides an interface to the Google website, utilizing Macromedia Flash MX, Flash Remoting, web services, and components from DevNet Resource Kits 1, 2, and 3.

It demonstrates a number of concepts and techniques, including how to:

  • Use components
  • Use Macromedia Flash Remoting to call remote web services
  • Architect complex, multiscreen applications
  • Abstract client/server communication code into custom classes
  • Cache data within and between user sessions
  • Submit forms when users press the Enter key
  • Use an event-driven model
  • Add Shift/Control-clicking to allow users to open links in new windows

Setting Up and Running the Application

Unzip SearchApplication.zip into a folder, making sure to maintain the folder structure of the ZIP file. This creates the following folders:

The following articles will help you get started with and learn about Search Application:

  • SearchApplication contains SearchApplication.fla, the main FLA that contains the graphics and symbols for the application
  • Classes contains all the ActionScript classes for the application
  • GoogleLibrary contains the files for an ActionScript library that interacts with the Google web services API and is referenced by files within the classes directory

In order to run Search Application, first you must obtain a Google key from Google. This allows you to call the Google web services.

Then you must specify two properties within the classes/SearchApplicationClass.as file. Open this file with a text editor (such as Dreamweaver or Notepad) and locate the following two lines:

this.gatewayURL = "/flashservices/gateway";
this.googleKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXX";

Replace the value for this.gatewayURL with the path to your Flash Remoting adapter. Replace the value for this.googleKey with your Google web service API key.

Once you've made these changes, save the file, open SearchApplication.fla, and test the movie (Control > Test Movie). Search Application should compile and allow you to perform searches.

Things to Watch For

Search Application should work after following the instructions above. If it does not, there are a couple of things to check:

  • Ensure that the server where you installed Flash Remoting is actually running.

    If you are using Flash Remoting installed on a ColdFusion MX server, and you've installed ColdFusion Updater Release 3 (or later), make sure that web services are turned on.
  • Ensure that you entered your Google API key correctly.
  • Ensure that you specified the correct path to the Flash Remoting adapter. If you are running the application locally (such as within the Macromedia Flash authoring environment) then you must specify the complete URL to the Flash Remoting adapter, such as:

    http://www.mydomain.com/flashservices/gateway

    If the server is on the same computer as Macromedia Flash then use this URL:

    http://127.0.0.1/flashservices/gateway

    Finally, if you are using the web server that comes with ColdFusion MX use this URL:

    http://127.0.0.1:8500/flashservices/gateway
  • Ensure that you maintained the folder structure when you unzipped SearchApplication.zip.